package qtdz6;

import javax.swing.*;

public class Battleship extends SeaObject {
    private int life;

    Battleship() {
        super(66, 26, 270, 124, 20);
        life = 5;
    }

    public void move() {
        System.out.println("战舰x左右移动啦!");
    }

    public ImageIcon getImage() {
        return Images.battleship;
    }

    //发射炸弹,生成炸弹对象
    public Bomb shootBomb() {
        return new Bomb(this.x, this.y);
    }

    //战舰左移
    public void moveLeft() {
        x -= speed;
    }

    //战舰右移
    public void moveRight() {
        x += speed;
    }
}
